#ifndef __LIB_AGORA_CORE_MUTEX_H__
#define __LIB_AGORA_CORE_MUTEX_H__

#include "IMutex.h"

#ifdef _WIN32

#ifndef AF_IPX
#include <windows.h>
#endif

namespace AgoraCore
{

class Mutex : public IMutex
{
public:
	Mutex();
	~Mutex();
	virtual void Lock();
	virtual void Unlock();
	virtual bool IsLock();

private:
	 bool _isLock;
	 CRITICAL_SECTION _criticalSection;
};

}

#else

#include <sys/types.h>
#include <pthread.h>

namespace AgoraCore
{

class Mutex : public IMutex
{
public:
	Mutex();
	~Mutex();
	virtual void Lock();
	virtual void Unlock();
	virtual bool IsLock();

private:
	bool _isLock;
	pthread_mutex_t _mutex;
};
}
#endif

#endif
